﻿@model BMS.ViewModels.CompanyModelList

@{
    ViewBag.Title = "Company Maintenance";
    TempData.Keep();
}

@section featured {
        <section class="featured">
            <div class="content-wrapper" align="center">
                <hgroup class="title">
                    <h1>@ViewBag.Message</h1>
                </hgroup>
            </div>
        </section>
}

<section>
    @if(Model.cm == null)
    {
        <h2>New Company Registration</h2>
        <br />
        using (Html.BeginForm("CreateCompany", "Maintenance"))
        {
            <table border="0" align="center">
                <tr>
                    <td align="right">@Html.LabelFor(m => m.cm.CompanyName)</td>
                    <td align="left">@Html.TextBoxFor(m => m.cm.CompanyName, new { style = "width:200px" })</td>
                </tr>
                <tr>
                    <td align="right">@Html.LabelFor(m => m.cm.Address1)</td>
                    <td align="left">@Html.TextBoxFor(m => m.cm.Address1, new { style = "width:300px" })</td>
                </tr>
                <tr>
                    <td align="right">@Html.LabelFor(m => m.cm.Address2)</td>
                    <td align="left">@Html.TextBoxFor(m => m.cm.Address2, new { style = "width:300px" })</td>
                </tr>
                <tr>
                    <td align="right">@Html.LabelFor(m => m.cm.Address3)</td>
                    <td align="left">@Html.TextBoxFor(m => m.cm.Address3, new { style = "width:300px" })</td>
                </tr>
                <tr>
                    <td align="right">@Html.LabelFor(m => m.cm.Address4)</td>
                    <td align="left">@Html.TextBoxFor(m => m.cm.Address4, new { style = "width:300px" })</td>
                </tr>
                <tr>
                    <td align="right">@Html.LabelFor(m => m.cm.Address5)</td>
                    <td align="left">@Html.TextBoxFor(m => m.cm.Address5, new { style = "width:300px" })</td>
                </tr>
                <tr>
                    <td align="right">@Html.LabelFor(m => m.cm.TelephoneNo)</td>
                    <td align="left">@Html.TextBoxFor(m => m.cm.TelephoneNo, new { style = "width:150px" })</td>
                </tr>
                <tr>
                    <td align="right">@Html.LabelFor(m => m.cm.FaxNo)</td>
                    <td align="left">@Html.TextBoxFor(m => m.cm.FaxNo, new { style = "width:150px" })</td>
                </tr>
            </table>
            <br />
            <input type="submit" value="Create" />
        }
    }
    else
    {
        <h2>Edit Company INformation</h2>
        <br />
        using (Html.BeginForm("ModifyCompany", "Maintenance"))
        {
            <table border="0" align="center">
                <tr>
                    <td align="right">@Html.LabelFor(m => m.cm.CompanyName)</td>
                    <td align="left">@Html.TextBox("CompanyName", Model.cm.CompanyName, new { style = "width:200px" })</td>
                </tr>
                <tr>
                    <td align="right">@Html.LabelFor(m => m.cm.Address1)</td>
                    <td align="left">@Html.TextBox("CompanyAdd1", Model.cm.Address1, new { style = "width:300px" })</td>
                </tr>
                <tr>
                    <td align="right">@Html.LabelFor(m => m.cm.Address2)</td>
                    <td align="left">@Html.TextBox("CompanyAdd2", Model.cm.Address2, new { style = "width:300px" })</td>
                </tr>
                <tr>
                    <td align="right">@Html.LabelFor(m => m.cm.Address3)</td>
                    <td align="left">@Html.TextBox("CompanyAdd3", Model.cm.Address3, new { style = "width:300px" })</td>
                </tr>
                <tr>
                    <td align="right">@Html.LabelFor(m => m.cm.Address4)</td>
                    <td align="left">@Html.TextBox("CompanyAdd4", Model.cm.Address4, new { style = "width:300px" })</td>
                </tr>
                <tr>
                    <td align="right">@Html.LabelFor(m => m.cm.Address5)</td>
                    <td align="left">@Html.TextBox("CompanyAdd5", Model.cm.Address5, new { style = "width:300px" })</td>
                </tr>
                <tr>
                    <td align="right">@Html.LabelFor(m => m.cm.TelephoneNo)</td>
                    <td align="left">@Html.TextBox("TeleNo", Model.cm.TelephoneNo, new { style = "width:150px" })</td>
                </tr>
                <tr>
                    <td align="right">@Html.LabelFor(m => m.cm.FaxNo)</td>
                    <td align="left">@Html.TextBox("FaxNo", Model.cm.FaxNo, new { style = "width:150px" })</td>
                </tr>
            </table>
            <br />
            <input type="submit" value="Modify" />
        }
    }
</section>

<section>
    @using (Html.BeginForm("BackToMainMeun", "Home"))
    {
        <br align="center" />
        <input type="submit" value="Back To Main Menu" />
    }
</section>